<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<body>
    <div id="app">
        <h1>我是父组件的标题</h1>
        <my-component>
            <!-- <p>初始内容1</p>
            <p>初始内容2</p> -->
            <li v-for="item in myltems">{{item.username}}--{{item.text}}</li>
        </my-component>
    </div>
    <template id="temp">
        <div>
            <h2>我是子组件的标题</h2>
                <ul>
                </hr>
                <form action="" method="get">
                    <input type="hidden" name="" value="jk">
                </form>
                    <slot><p>如果父组件没有插入内容，我将会默默出现在你的身后</p></slot>
                </hr>
                </ul>
        </div>
    </template>
    <script type="text/javaScript" charset="UTF-8" src="/JS文件/vue.js"></script>
    <script>
        Vue.component("my-component",{
            template:'#temp',
        })
        new Vue({
            el:'#app',
            data:{
                myltems:[
                    {username:"Vue",text:"Vue 课程"},
                    {username:"javascript",text:"javascript 课程"},
                    {username:"Html",text:"HTML 课程"}
                ]
            }
        })
    </script>
</body>
</html>